import request from "../../utils/request.ts";
import {message} from 'antd';
import type {AxiosResponse} from 'axios'

export const handlebedList = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/list', params)
        return res.data
    } catch (err) {
        message.error('获取综合列表失败')
        throw err
    }
}
export const handlebedListEdit = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/edit', params)
        return res.data
    } catch (err) {
        message.error('修改列表失败')
        throw err
    }
}
export const handlebedSearch = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/search', params)
        return res.data
    } catch (err) {
        message.error('查询列表失败')
        throw err
    }
}
export const handlebedDel = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/del', params)
        return res.data
    } catch (err) {
        message.error('批量生产列表失败')
        throw err
    }
}
export const handlebedBatchDel = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/batchdel', params)
        return res.data
    } catch (err) {
        message.error('批量生产列表失败')
        throw err
    }
}
export const handlebedAdd = async (params: any): Promise<AxiosResponse> => {
    try {
        const res: AxiosResponse<any, any> = await request.get('/bedtable/add', params)
        return res.data
    } catch (err) {
        message.error('批量生产列表失败')
        throw err
    }
}